        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">EDIT PROJECT (<?PHP echo $row->project_name; ?>)</h1>
                </div>
                <!-- /.col-lg-12 -->
				<div class="row body-page">
					<?php echo form_open_multipart('project/save_edit/'.$row->client_id.'/'.$row->id,array('class'=>'form')); ?>
					
							<div class="panel panel-default">
								  <div class="panel-heading">
									<h3 class="panel-title">Add Project Information</h3>
								  </div>
								 <div class="panel-body">
								<div class="input-group">
								<span class="input-group-addon">Company Name:</span>
								   <input type="text" name='company_name' value='<?php echo $row->company_name; ?>' class="form-control form-input-over" placeholder="Company Name" />
								</div>
							
								<div class="input-group">
								 <span class="input-group-addon">Company Invoicing Name:</span> 
								   <textarea class="form-control form-input-over" name='comp_inv_name' placeholder="Company Invoicing Name"><?php echo $row->comp_inv_name; ?></textarea>
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Company Address:</span>
								   <input type="text" name='comp_address' value='<?php echo $row->comp_address; ?>' class="form-control form-input-over" placeholder="Company Address" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Project Icon:</span>
								   <input type="file" name='project_icon' accept="image/*" class="form-control form-input-over" placeholder="Project Icon" />
								   <img src='<?php echo site_url($row->project_icon); ?>' class='pr-icon' />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Project Name:</span>
								   <input type="text" name='project_name' value="<?php echo $row->project_name; ?>" class="form-control form-input-over" placeholder="Project Name" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">AFE / PO #:</span>
								   <input type="text" name='afe_po_num' value="<?php echo $row->afe_po_num; ?>" class="form-control form-input-over" placeholder="AFE / PO #" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Project Manager Contact Name:</span>
								   <input type="text" name='p_manager' value="<?php echo $row->p_manager; ?>" class="form-control" placeholder="Project Manager Contact Name" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Phone # 1:</span>
									 <input type="text" name='pm_phone1' value="<?php echo $row->pm_phone1; ?>" class="form-control form-input-over" placeholder="Phone # 1" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Phone # 2:</span>
									 <input type="text" name='pm_phone2' value="<?php echo $row->pm_phone2; ?>" class="form-control form-input-over" placeholder="Phone # 2" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Email:</span>
								   <input type="text" name='pm_email' value="<?php echo $row->pm_email; ?>" class="form-control form-input-over" placeholder="Email" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Secondary Contact Name:</span>
								   <input type="text" name='second_contact_name' value="<?php echo $row->second_contact_name; ?>" class="form-control form-input-over" placeholder="Secondary Contact Name" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Phone # 1:</span>
								   <input type="text" name='sc_phone1' value="<?php echo $row->sc_phone1; ?>" class="form-control form-input-over" placeholder="Phone # 1" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Phone # 2:</span>
								   <input type="text" name='sc_phone2' value="<?php echo $row->sc_phone2; ?>" class="form-control form-input-over" placeholder="Phone # 2" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Email:</span>
								   <input type="text" name='sc_email' value="<?php echo $row->sc_email; ?>" class="form-control form-input-over" placeholder="Email" />
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Project Description:</span>
								   <input type="text" name='project_desc' value="<?php echo $row->project_desc; ?>" class="form-control form-input-over" placeholder="Project Description" />
								</div>
								
								<div class="input-group date" id='start_date' data-format="yyyy-MM-dd">
								   <span class="input-group-addon">Project Start Date:</span>
										<input type='text' class="form-control form-input-over" value="<?php echo $row->project_start_date; ?>"  name="project_start_date" />
										<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
									</span>
								</div>
								<div class="input-group date" id='end_date' data-format="yyyy-MM-dd">
								   <span class="input-group-addon">Project End Date:</span>
								   <input type='text' class="form-control form-input-over" value="<?php echo $row->project_end_date; ?>" name="project_end_date" />
								   <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Add Project Location:</span>
									<button type='button' class='btn btn-success pr-loc' id='addlocation'><span class='glyphicon glyphicon-pushpin'></span> Add Project Location</button>
								</div>
								
								<div class="input-group">
								   <span class="input-group-addon">Position in Longitude:</span>
									<input type='text' name='lat' value='<?php echo $row->lat ?>' readonly class='form-control form-input-over' id='loc_lat' />
								</div>
								<div class="input-group">
								   <span class="input-group-addon">Position in Latitude:</span>
									<input type='text' name='lng' value='<?php echo $row->lng ?>' readonly class='form-control form-input-over' id='loc_lng' />
								</div>
								
								<div class="input-group">
								   <button type='submit' class='btn btn-primary'><span class='glyphicon glyphicon-edit'></span> EDIT PROJECT</button>
								</div>

							  </div>
							</div>
							
					<?php echo form_close(); ?>
				</div>
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->
		
		<script type='text/javascript'>
			$('#addlocation').click(function(){
				$('#map-holder').modal('show');
				setTimeout(function() {
					  map_ini();
				}, 500);
			});
			

	var map;
	var markersArray = []; 
function map_ini(){
var myLatlng = new google.maps.LatLng(<?php echo $row->lat ?>,<?php echo $row->lng ?>);
var mapOptions = {
    zoom: 4
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);

  // Try HTML5 geolocation
  if(navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      var pos = new google.maps.LatLng(position.coords.latitude,
                                       position.coords.longitude);
      map.setCenter(pos);
    }, function() {
      handleNoGeolocation(true);
    });
  } else {
    // Browser doesn't support Geolocation
    handleNoGeolocation(false);
  }
	
	var marker = new google.maps.Marker({
		position: myLatlng, 
		map: map
	});
	
	google.maps.event.addListener(map, 'click', function(event) {
		placeMarker(event.latLng);
		$('#loc_lat').val(event.latLng.lat());
		$('#loc_lng').val(event.latLng.lng());
		
	});	
		
}// end map initialize..

function placeMarker(location) {
	// first remove all markers if there are any
	deleteOverlays();

	var marker = new google.maps.Marker({
		position: location, 
		map: map
	});

	// add marker in markers array
	markersArray.push(marker);

	//map.setCenter(location);
} // end function place marker..

function deleteOverlays() {
	if (markersArray) {
		for (i in markersArray) {
			markersArray[i].setMap(null);
		}
	markersArray.length = 0;
	}
}// end function delete marker..

function handleNoGeolocation(errorFlag) {
  if (errorFlag) {
    var content = 'Error: The Geolocation service failed.';
  } else {
    var content = 'Error: Your browser doesn\'t support geolocation.';
  }

  var options = {
    map: map,
    position: new google.maps.LatLng(60, 105),
    content: content
  };

  var infowindow = new google.maps.InfoWindow(options);
  map.setCenter(options.position);
}
	
		</script>